home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44a.zip / BUFF13.QM < prev    next >
Text File  |  1992-02-17  |  47KB  |  874 lines

  1. *                            BUFF13.QM, v1.3a
  2. *     Access Scratch Buffers with the Previous Buffer Name at Prompt,
  3. *     Save and Reload Currently Loaded Buffers at Next Edit Session
  4. *                                2/17/92
  5. *
  6. *  Key       Subfile            Description
  7. * =====    =============    ==============================================
  8. * ^(2_)-   {e:\up\FILE*}    Copy CurrentFileName to Scrap/Scratch Buffers |new
  9. *                           Without Changing Edit Status of Current File
  10. * ^(6_)-   {e:\up\FILE*}    Get CurrentFileName from Scratch Buffer       |new
  11. *                           Without Changing Edit Status of Current File
  12. *
  13. * @(F1)-                    Clear Scrap and Scratch Buffers               |new
  14. * @(F2)-                    Cut CurrentFileName Extension To Scrap        |new
  15. * @(F3)-                    Cut CurrentFileName Extension To Scrap,       |new
  16. *                               Adds Dot If No Extension
  17. * ------------------- Insert Buffer Name at Prompt -------------------*
  18. * @(1) -                    STORE or Copy Marked Block      ┐
  19. * @(2) -                    GET or Insert Buffer Contents   ├─ Require v2.15
  20. * @(3) -                    APPEND Marked Block             ┘
  21. * @(4) -                    Remove Buffer Contents
  22. *
  23. * ---------------- Contents Selected From a PickList ----------------*
  24. * @(7) -                    GET or Insert Buffer Contents
  25. * @(8) -                    Remove Buffer Contents
  26. *
  27. * @(6) -                    View Contents of All Currently Loaded Buffers
  28. * @(9) -                    Save Contents of All Currently Loaded Buffers
  29. * @(0) -                    Load Buffers From Previous Edit Session
  30. *
  31. *     (Description)
  32. *     (Configuration) Required  <<<<<-- Please read this FIRST
  33. *     (Macros)
  34. *     (Version) History
  35. *
  36. *--- eoi
  37.  
  38. * (DESCRIPTION)
  39.  
  40. *     These macros access and manipulate Scratch Buffers the same way
  41. *     StoreScrBuff, GetScrBuff and AppendScrBuff do except the last
  42. *     accessed buffer name is entered at the buffer name prompt when
  43. *     macros @1 - @4 are invoked.  This is especially useful when a few
  44. *     Scratch Buffers are frequently accessed because QEdit does not
  45. *     remember and show the last accessed Scratch Buffer name at the
  46. *     buffer name prompt without having to recall and enter the buffer
  47. *     name.  Macro @6 will show the contents of all loaded Scratch
  48. *     Buffers by name.  Macros @7 and @8 enable the user to access
  49. *     Scratch Buffers from a PickList of all loaded Scratch Buffers by
  50. *     name.  All currently loaded Scratch Buffers may also be saved
  51. *     with @9 and reloaded with @0 at the next edit session or at start
  52. *     up.
  53.  
  54. *     All macros, except @0, will fit on one line of QCONFIG.DAT by
  55. *     removing the 'Label' and 'Macro_Begin' from the QMAC compiled
  56. *     macros and formatting with a right margin of 500, and then
  57. *     using joinline to get any remaining commands on the same line.
  58.  
  59. *     Macros @1 - @6 will work with line, character or column blocks,
  60. *     however macros @7 -@0 will ONLY work with line or character
  61. *     blocks, NO column blocks.
  62.  
  63. * (CONFIGURATION)
  64.  
  65. * NOTE: 1) Macros @1 - @4 are the only macros not requiring
  66. *       configuration.  You must change 'e:\up\' in macros @6 - @0 to
  67. *       your directory containing the files for BUFFxx.QM macros, then
  68. *       recompile using QMAC.
  69.  
  70. *       2) The following files must either exist or must be made as
  71. *       described below:
  72.  
  73. *             BUFF.BAT   batch file to invoke @0
  74. *             BUFF.NAM   list of Scratch Buffer names to be used
  75. *             BUFF.ALL   all currently loaded Scratch Buffers,
  76. *                        @9 makes this file when invoked
  77.  
  78. *       3) Macros @1 - @4 require QEdit v2.15.
  79.  
  80. * (MACROS)
  81.  
  82. * 
  83. * ----------------------------------------------
  84. * @(0) Load Buffers From Previous Edit Session
  85. * ----------------------------------------------
  86. *     This macro enables the user to load, either upon start up or
  87. *     while editing, all Scratch Buffers that were saved in the last
  88. *     edit session using @9.  This macro is a modification of a macro
  89. *     in the QEdit documentation to load a set of "standard" buffers.
  90. *     @0 may also be invoked while editing.
  91.  
  92. *     This macro will ONLY work with line or character blocks, NO
  93. *     column blocks.  Any column block buffer saved with @9 will be
  94. *     loaded with @0 as a CHARACTER block.  To run, invoke this macro
  95. *     at any time or at startup as described below, and the macro
  96. *     terminates with all buffers that were saved in the last editing
  97. *     session with @9 loaded and shown in the NUL file for viewing.  The
  98. *     NUL file may be quit but this is not necessary.
  99.  
  100. *     To invoke this macro at start up and load this file, it's macros,
  101. *     and the scratch buffers saved in the last editing session, use
  102. *     the following batch file BUFF.BAT contained in AMACxx.ZIP:
  103.  
  104. *     ┌────────────────────── BUFF.BAT ──────────────────────┐
  105. *     │                                                      │
  106. *     │    Q   BUFF13.QM   /EBUFF13.MAC    /LBUFF13.MAC      │
  107. *     │                                                      │
  108. *     └──────────────────────────────────────────────────────┘
  109.  
  110. *     The user may wish to modify BUFF.BAT by changing e:\up\ in the
  111. *     statement line to the directory containing BUFF.BAT so that all
  112. *     macros in BUFFxx.QM will be available to invoke from any
  113. *     directory.  To invoke this macro while editing press @0.
  114.  
  115. *     NOTE: You must change 'e:\up\' in this macro to your directory
  116. *           containing BUFF.ALL.  @0 must be the first macro in this
  117. *           file to autoexecute on start up.  All Scratch Buffers will
  118. *           be changed to character blocks with @6 and @0.
  119.  
  120. @0 macrobegin
  121. * ------------- Load Buffers From Previous Edit Session -------------*
  122.         editfile
  123.             'e:\up\BUFF.ALL' return     * Load last buffer file
  124.                                         * Change 'e:\up\' to your directory
  125.         begfile                         * Go to the top of it
  126.         markline copy                   * Copy first buffer name to scrap
  127.         cursordown                      * Cursor down to first buffer
  128.         markblockbegin                  * Mark beginning of buffer
  129.         find #254 return delline return * Find the end of the buffer marker
  130.         markblockend                    * Mark the end of buffer
  131.         storescrbuff paste return       * Store the buffer to name
  132.         cursordown                      * Cursor down to second buffer
  133.     LOOP:                               * Do same thing for next buffer
  134.         unmarkblock                     * Clear buffer content block
  135.         begline                         * Re-position from Find
  136.         markline                        * Mark buffer name
  137.         copy                            * Copy name to scrap
  138.         cursordown                      * Are we at bottom of file yet?
  139.     jfalse DONE                         * If we can't cursor down, we're done
  140.         markblockbegin                  *ELSE mark buffer begin
  141.         repeatfind                      * Find end of buffer marker
  142.         cursorleft                      * Test if we're on marker in col 1
  143.     jtrue 1                             * If true, we're not in col 1
  144.         insertline                      *ELSE we need to insert line for buff
  145.         cursordown                      * Move back to marker line
  146.     jump 2                              * Bypass next line
  147.     1:  cursorright                     * Position cursor back on marker
  148.     2:  markblockend                    * Mark buffer end
  149.         storescrbuff paste return       * Store buffer to name
  150.         cursordown                      * Cursor down to next buffer name
  151.     jump LOOP                           * Loop again
  152.     DONE:                               * Come here when no more names
  153.         quit                            * Quit BUFF.ALL
  154. * ---------- View Contents of All Currently Loaded Buffers ----------*
  155.         onewindow                       * In case @0 invoked while editing
  156.         editfile "NUL" return quit      * Quit NUL file if loaded
  157.         horizontalwindow                * Make two windows
  158.         editfile return                 * Load empty NUL file
  159.         readblock                       * Read file of buffer names
  160.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  161.     LOOP2:
  162.         begline                         * Needed in loop
  163.         unmarkblock
  164.         markline                        * Mark next buffer name
  165.         copy                            * Copy name to scrap
  166.         addline                         * Make room for buff contents
  167.         getscrbuff paste return         * Get buffer contents
  168.         endline                         * Pos and test if buff has contents
  169.     jfalse NOBUFF                       * If buffer has no contents, move on
  170.         gotoblockend                    * Go to end of buffer contents
  171.         ENDLINE                         * Pos for end of buffer mark
  172.                                         * Needed for last buffer line blank
  173.         #254                            * Add end of buffer mark
  174.         cursordown                      * Move down to next line
  175.         begline endline                 * Test if line is blank
  176.     jfalse DELLINE                      * If blank, go delete it
  177.     jump LOOP2                          *ELSE loop again
  178.     NOBUFF:                             * Come here if nothing in buffer
  179.         cursordown                      * Test if we're at end of buffer names
  180.     jfalse PICK                         * If false, PickList is made
  181.         cursorup                        *ELSE cursor up to blank line
  182.         cursorup                        * and to name with no content
  183.         delline                         * Delete buffer name
  184.     DELLINE:
  185.         delline                         * Delete blank line
  186.     jump LOOP2                          * Loop again
  187.     PICK:                               * Come here to select from PickList
  188.         zoomwindow                      * Full window for visibity
  189.         unmarkblock                     * Clear last buffer content's block
  190.         begfile                         * Position to view
  191.         onewindow                       * Close windows if QConfig
  192.     END:                                * set to NOT close on quit
  193. *
  194. * 162 bytes Tue  08-20-1991  11:21:31 (TH @0)
  195.  
  196. * 
  197. * --------------------------------------------------------------------------
  198. * @(1) STORE or Copy Marked Block to Previous or New Buffer Name,
  199. *      Previous Buffer Name is Entered at Request for Buffer Name Prompt
  200. * --------------------------------------------------------------------------
  201. *     This macro copies the currently marked Block to the named Scratch
  202. *     Buffer.  The last accessed buffer name is entered at request for
  203. *     buffer name prompt.  Blocks may be either line, character or
  204. *     column blocks--open or closed.
  205.  
  206. *     The editor will prompt for the name of the Scratch Buffer with
  207. *     this macro entering the name of the last accessed buffer invoked,
  208. *     on the 'Request for Buffer Name Prompt' line.  If no buffer has
  209. *     been previously named with these macros, the 'Buffer Name Prompt'
  210. *     is blank for user entry.  The previously named buffer may be
  211. *     overwritten or selected by hitting <enter>.  If no buffer name is
  212. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  213. *     the default Scratch Buffer name dot '.'
  214.  
  215. @1 macrobegin
  216.         SetScreenOff
  217.         onewindow
  218.         editfile "NUL" return quit      * Quit NUL file if loaded
  219.         GotoBlockBeg                    * Test if closed
  220.    jfalse END
  221.         storescrbuff "t" return         * Store block to temp buff 't'
  222.         deleteblock                     * Delete block to put back later
  223.         horizontalwindow                * Make two windows
  224.         editfile return                 * Load empty NUL file
  225.         SetInsMode ToggleInsert
  226.         getscrbuff "n" return           * Get previous buff 'n'
  227.         gotoblockbeg                    * Test if buff 'n' had contents
  228.     jtrue NEXT                          * If buffer exists, bypass next line
  229.         dropanchor                      *ELSE make dummy block so cut does
  230.                                         *  not cut empty line to scrap
  231.     NEXT:
  232.         cut                             * Cut prev buff name to scrap
  233.         "Buff="                         * Insert Buff= on top line of NUL
  234.         paste                           * Paste prev buff name
  235.         markcharacter                   * Start character block
  236.         zoomwindow                      * Make NUL file full window
  237.         SetScreenOn Pause SetScreenOff
  238.         endline                         * Get all name in block
  239.         dropanchor                      * Close block
  240.         gotoblockbeg                    * Pos cursor on first char of name
  241.         endline                         * Test if char exists
  242.     jtrue HasName                       * If true, buff has name
  243.         "."                             *ELSE no buff named, name it 'dot'
  244.     HasName:                            * Buff now has name
  245.         storescrbuff "n" return         * Store name to buff 'n'
  246.         copy                            * Copy buff name to scrap
  247.         getscrbuff "t" return           * Insert temp buff 't'
  248.         storescrbuff paste return       * Save it with new buff name
  249.         toggleinsert                    * Toggle Insert back On
  250.         quit                            * Quit NUL file
  251.         prevwindow                      * Return to starting file
  252.         getscrbuff paste return         * Put orig block back where it was
  253.         onewindow                       * Close all windows if QConfig
  254.     END:                                * set to NOT close on quit
  255. *
  256. * 89 bytes Mon  08-19-1991  13:42:56 (TH @1)
  257. * 83 bytes Sat  10-26-1991  07:47:01 (TH @1, v2.15)
  258.  
  259. * 
  260. * --------------------------------------------------------------------------
  261. * @(2) GET or Insert Previous or New Buffer Name Contents at Cursor Position,
  262. *      Previous Buffer Name is Entered at Request for Buffer Name Prompt
  263. * --------------------------------------------------------------------------
  264. *     This macro inserts the contents of the named Scratch Buffer at
  265. *     the cursor position.  The last accessed buffer name is entered at
  266. *     request for buffer name prompt.  Blocks may be either line,
  267. *     character or column blocks--open or closed.
  268.  
  269. *     The editor will prompt for the name of the Scratch Buffer.  The
  270. *     macro enters the name of the last accessed buffer name invoked on
  271. *     the 'Request for Buffer Name Prompt' line.  If no buffer has been
  272. *     previously named with these macros, the 'Buffer Name Prompt' is
  273. *     blank for user entry.  The previously named buffer may be
  274. *     overwritten or selected by hitting <enter>.  If no buffer name is
  275. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  276. *     the scratch buffer name dot '.'
  277.  
  278. @2 macrobegin
  279.         SetScreenOff
  280.         onewindow                       * Close all windows
  281.         dropanchor                      * Mark starting file to return to
  282.         editfile "NUL" return quit      * Quit NUL file if loaded
  283.         GotoBlockBeg                    * Return to starting file
  284.         unmarkblock                     * Unmark
  285.         horizontalwindow                * Make two windows
  286.         editfile return                 * Load empty NUL file
  287.         SetInsMode ToggleInsert
  288.         getscrbuff "n" return           * Get previous buff 'n'
  289.         gotoblockbeg                    * Test if buff 'n' had contents
  290.     jtrue NEXT                          * If buffer exists, bypass next line
  291.         dropanchor                      * Make dummy block so cut does not
  292.                                         *  cut empty line to scrap
  293.     NEXT:
  294.         cut                             * Cut prev buff name to scrap
  295.         "Buff="                         * Insert Buff= on top line of NUL
  296.         paste                           * Paste prev buff name
  297.         markcharacter                   * Start character block
  298.         zoomwindow                      * Make NUL file full window
  299.         SetScreenOn Pause SetScreenOff
  300.         endline                         * Get all name in block
  301.         dropanchor                      * Close block
  302.         gotoblockbeg                    * Pos cursor on first char of name
  303.         endline                         * Test if char exists
  304.     jtrue HasName                       * If true, buff has name
  305.         "."                             *ELSE no buff named, name it 'dot'
  306.     HasName:                            * Buff now has name
  307.         storescrbuff "n" return         * Store name to buff 'n'
  308.         copy                            * Copy buff name to scrap
  309.         toggleinsert                    * Toggle Insert back On
  310.         quit                            * Quit NUL file
  311.         prevwindow                      * Return to starting file
  312.         getscrbuff paste return         * Insert buff contents here
  313.         onewindow                       * Close all windows if QConfig
  314.     END:                                * set to NOT close on quit
  315. *
  316. * 76 bytes Mon  08-19-1991  13:43:05 (TH @2)
  317. * 70 bytes Sat  10-26-1991  07:58:29 (TH @2, v2.15)
  318.  
  319. * 
  320. * --------------------------------------------------------------------------
  321. * @(3) APPEND Marked Block to End of Previous or New Buffer Name,
  322. *      Previous Buffer Name is Entered at Request for Buffer Name Prompt
  323. * --------------------------------------------------------------------------
  324. *     This macro appends the currently marked Block to the end of the
  325. *     named Scratch Buffer.  The last accessed buffer name is entered
  326. *     at request for buffer name prompt.  The existing contents of the
  327. *     named Scratch Buffer are not lost invoking this macro.  If the
  328. *     named Scratch Buffer does not exist, a new Scratch Buffer will be
  329. *     created.  Blocks may be either line, character or column
  330. *     blocks--open or closed.
  331.  
  332. *     The editor will prompt for the name of the Scratch Buffer.  The
  333. *     macro enters the name of the last accessed buffer name invoked on
  334. *     the 'Request for Buffer Name Prompt' line.  If no buffer has been
  335. *     previously named with these macros, the 'Buffer Name Prompt' is
  336. *     blank for user entry.  The previously named buffer may be
  337. *     overwritten or selected by hitting <enter>.  If no buffer name is
  338. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  339. *     the scratch buffer name dot '.'
  340.  
  341. @3 macrobegin
  342.         SetScreenOff
  343.         onewindow
  344.         editfile "NUL" return quit      * Quit NUL file if loaded
  345.         GotoBlockBeg                    * Test if closed
  346.    jfalse END
  347.         storescrbuff "t" return         * Store block to temp buff 't'
  348.         deleteblock                     * Delete block to put back later
  349.         horizontalwindow                * Make two windows
  350.         editfile return                 * Load empty NUL file
  351.         SetInsMode ToggleInsert
  352.         getscrbuff "n" return           * Get previous buff 'n'
  353.         gotoblockbeg                    * Test if buff 'n' had contents
  354.     jtrue NEXT                          * If buffer exists, bypass next line
  355.         dropanchor                      * Make dummy block so cut does not
  356.                                         *  cut empty line to scrap
  357.     NEXT:
  358.         cut                             * Cut prev buff name to scrap
  359.         "Buff="                         * Insert Buff= on top line of NUL
  360.         paste                           * Paste prev buff name
  361.         markcharacter                   * Start character block
  362.         zoomwindow                      * Make NUL file full window
  363.         SetScreenOn Pause SetScreenOff
  364.         endline                         * Get all name in block
  365.         dropanchor                      * Close block
  366.         gotoblockbeg                    * Pos cursor on first char of name
  367.         endline                         * Test if char exists
  368.     jtrue HasName                       * If true, buff has name
  369.         "."                             *ELSE no buff named, name it 'dot'
  370.     HasName:                            * Buff now has name
  371.         storescrbuff "n" return         * Store name to buff 'n'
  372.         copy                            * Copy buff name to scrap
  373.         getscrbuff "t" return           * Insert temp buff 't'
  374.         appendscrbuff paste return      * Append block to buff 'n'
  375.         toggleinsert                    * Toggle Insert back On
  376.         quit                            * Quit NUL file
  377.         prevwindow                      * Return to starting file
  378.         getscrbuff "t" return           * Put orig block back where it was
  379.         onewindow                       * Close all windows if QConfig
  380.     END:                                * set to NOT close on quit
  381. *
  382. * 90 bytes Mon  08-19-1991  13:43:01 (TH @3)
  383. * 84 bytes Sat  10-26-1991  07:58:42 (TH @3, v2.15)
  384.  
  385. * 
  386. * --------------------------------------------------------------------------
  387. * @(4) Remove Buffer Contents with Previous Buffer Name at Prompt
  388. * --------------------------------------------------------------------------
  389. *     This macro removes the contents of the named Scratch Buffer.  The
  390. *     last accessed buffer name is entered at request for buffer name
  391. *     prompt.  Blocks may be either line, character or column
  392. *     blocks--open or closed.  This macro is useful for freeing up
  393. *     buffer space or removing buffers before saving with @9.
  394.  
  395. *     The editor will prompt for the name of the Scratch Buffer.  The
  396. *     macro enters the name of the last accessed buffer name invoked on
  397. *     the 'Request for Buffer Name Prompt' line.  If no buffer has been
  398. *     previously named with these macros, the 'Buffer Name Prompt' is
  399. *     blank for user entry.  The previously named buffer may be
  400. *     overwritten or selected by hitting <enter>.  If no buffer name is
  401. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  402. *     the scratch buffer name dot '.'
  403.  
  404. @4 macrobegin
  405.         SetScreenOff
  406.         onewindow                       * Close all windows
  407.         dropanchor                      * Mark starting file to return to
  408.         editfile "NUL" return quit      * Quit NUL file if loaded
  409.         GotoBlockBeg                    * Return to starting file
  410.         unmarkblock                     * Unmark
  411.         horizontalwindow                * Make two windows
  412.         editfile return                 * Load empty NUL file
  413.         SetInsMode ToggleInsert
  414.         getscrbuff "n" return           * Get previous buff 'n'
  415.         gotoblockbeg                    * Test if buff 'n' had contents
  416.     jtrue NEXT                          * If buffer exists, bypass next line
  417.         dropanchor                      * Make dummy block so cut does not
  418.                                         *  cut empty line to scrap
  419.     NEXT:
  420.         cut                             * Cut prev buff name to scrap
  421.         "Buff="                         * Insert Buff= on top line of NUL
  422.         paste                           * Paste prev buff name
  423.         markcharacter                   * Start character block
  424.         zoomwindow                      * Make NUL file full window
  425.         SetScreenOn Pause SetScreenOff
  426.         endline                         * Get all name in block
  427.         dropanchor                      * Close block
  428.         gotoblockbeg                    * Pos cursor on first char of name
  429.         endline                         * Test if char exists
  430.     jtrue HasName                       * If true, buff has name
  431.         "."                             *ELSE no buff named, name it 'dot'
  432.     HasName:                            * Buff now has name
  433.         storescrbuff "n" return         * Store name to buff 'n'
  434.         copy                            * Copy buff name to scrap
  435.         toggleinsert                    * Toggle Insert back On
  436.         endline dropanchor              * Mark empty block
  437.         storescrbuff paste return       * Store empty block to buff n
  438.                                         * clears it
  439.         quit                            * Quit NUL file
  440.         prevwindow                      * Return to starting file
  441.         onewindow                       * Close all windows if QConfig
  442.     END:                                * set to NOT close on quit
  443. *
  444. * 78 bytes Tue  08-20-1991  11:34:56 (TH @a)
  445. * 72 bytes Sat  10-26-1991  07:59:04 (TH @4)
  446.  
  447. * 
  448. * ----------------------------------------------------
  449. * @(6) View Contents of All Currently Loaded Buffers
  450. * ----------------------------------------------------
  451. *     This macro enables the user to view the contents of all currently
  452. *     loaded Scratch Buffers.  This macro uses the technique in a macro
  453. *     in the QEdit documentation to load a set of "standard" buffers.
  454. *     This macro will ONLY work with line or character blocks, NO
  455. *     column blocks.  To run, press @6 and <enter> and the contents of
  456. *     all currently loaded Scratch Buffers is shown in the NUL file for
  457. *     viewing in the following form:
  458.  
  459. *     ┌──────   NUL    ──────┐
  460. *     │1                     │<-- Buffer 1 name
  461. *     │Text of buffer 1■     │<-- Buffer 1 content
  462. *     │2                     │<-- Buffer 2 name
  463. *     │This is content of    │<-- Buffer 2 content
  464. *     │buffer number 2.      │               |
  465. *     │                      │               |
  466. *     │Note that buffers may │               |
  467. *     │contain any text      │               |
  468. *     │except for an ASCII   │               |
  469. *     │254.  That is used    │               |
  470. *     │as an end of buffer   │               |
  471. *     │marker                │               |
  472. *     │■                     │<-- NOTE: delimiter on line by itself
  473. *     │3                     │          indicates a blank line.
  474. *     │Buffer 3■             │
  475. *     └──────────────────────┘
  476.  
  477. *     After viewing the buffer contents, the NUL file may be quit but
  478. *     this is not necessary.
  479.  
  480. *     NOTE: You must change 'e:\up\' in this macro to your directory
  481. *           containing BUFF.NAM.  This file must exist for this macro
  482. *           to work and it is easily made as shown below.
  483.  
  484. *     File BUFF.NAM is a list of buffer names to be used:
  485.  
  486. *                 1 to 10
  487. *                 a to z (excluding n and t)
  488. *                 .      (dot)
  489.  
  490. *     ┌─────  BUFF.NAM ──────┐
  491. *     │1                     │<-- Buffer names 1 - 10
  492. *     │2                     │
  493. *     │3                     │
  494. *     │4                     │
  495. *     │5                     │
  496. *     │6                     │
  497. *     │7                     │
  498. *     │8                     │
  499. *     │9                     │
  500. *     │10                    │
  501. *     │a                     │ <-- Buffer names a - z
  502. *     │b                     │     excluding 'n' and 't'
  503. *     │|                     │     reserved for BUFFxx.QM macros.
  504. *     │|                     │
  505. *     │z                     │
  506. *     │.                     │ <-- Buffer name '.' (dot) is
  507. *     └──────────────────────┘     reserved as default name.
  508.  
  509. @6 macrobegin
  510.         onewindow
  511.         dropanchor                      * Mark file we're in to return to
  512.         editfile "NUL" return quit      * Quit NUL file if loaded
  513.         gotoblockbeg                    * Return to starting file
  514.         unmarkblock                     * Clear mark
  515.         horizontalwindow                * Make two windows
  516.         editfile return                 * Load empty NUL file
  517.         readblock                       * Read file of buffer names
  518.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  519.     LOOP:
  520.         begline                         * Needed in loop
  521.         unmarkblock
  522.         markline                        * Mark next buffer name
  523.         copy                            * Copy name to scrap
  524.         addline                         * Make room for buff contents
  525.         getscrbuff paste return         * Get buffer contents
  526.         endline                         * Pos and test if buff has contents
  527.     jfalse NOBUFF                       * If buffer has no contents, move on
  528.         gotoblockend                    * Go to end of buffer contents
  529.         ENDLINE                         * Pos for end of buffer mark
  530.                                         * Needed for last buffer line blank
  531.     jtrue 1
  532.         gotoblockend
  533.     1:  #254                            * Add end of buffer mark
  534.         cursordown                      * Move down to next line
  535.         begline endline                 * Test if line is blank
  536.     jfalse DELLINE                      * If blank, go delete it
  537.     jump LOOP                           *ELSE loop again
  538.     NOBUFF:                             * Come here if nothing in buffer
  539.         cursordown                      * Test if we're at end of buffer names
  540.     jfalse PICK                         * If false, PickList is made
  541.         cursorup                        *ELSE cursor up to blank line
  542.         cursorup                        * and to name with no content
  543.         delline                         * Delete buffer name
  544.     DELLINE:
  545.         delline                         * Delete blank line
  546.     jump LOOP                           * Loop again
  547.     PICK:                               * Come here to select from PickList
  548.         zoomwindow                      * Full window for visibity
  549.         unmarkblock                     * Clear last buffer content's block
  550.         begfile                         * Position to view
  551.         onewindow                       * Close windows if QConfig
  552.     END:                                * set to NOT close on quit
  553. *
  554. * 78 bytes Mon  08-19-1991  13:43:19 (TH @6)
  555. * 94 bytes Tue  08-20-1991  11:22:00 (TH @6, added e:\up)
  556.  
  557. * 
  558. * ---------------------------------------------------------
  559. * @(7) GET or Insert Buffer Contents at Cursor Position
  560. *      From a PickList of All Currently Loaded Buffers
  561. * ---------------------------------------------------------
  562. *     This macro enables the user to insert a Scratch Buffer at the
  563. *     cursor position selected from a PickList of all currently loaded
  564. *     Scratch Buffers.  At the pause, place the cursor line on the name
  565. *     of the buffer to insert and press <enter>.  The selected buffer
  566. *     will be inserted at the cursor position when this macro was
  567. *     invoked.
  568.  
  569. *     This macro will ONLY work with line or character blocks, NO
  570. *     column blocks.
  571.  
  572. *     NOTE: You must change 'e:\up\' in this macro to your directory
  573. *           containing BUFF.NAM.  This file must exist for this macro
  574. *           to work and it is easily be made as shown below.
  575.  
  576. @7 macrobegin
  577.         onewindow
  578.         dropanchor                      * Mark file we're in to return to
  579.         editfile "NUL" return quit      * Quit NUL file if loaded
  580.         gotoblockbeg                    * Return to starting file
  581.         unmarkblock                     * Clear mark
  582.         horizontalwindow                * Make two windows
  583.         editfile return                 * Load empty NUL file
  584.         readblock                       * Read file of buffer names
  585.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  586.     LOOP:
  587.         begline                         * Needed in loop
  588.         unmarkblock
  589.         markline                        * Mark next buffer name
  590.         copy                            * Copy name to scrap
  591.         addline                         * Make room for buff contents
  592.         getscrbuff paste return         * Get buffer contents
  593.         endline                         * Pos and test if buff has contents
  594.     jfalse NOBUFF                       * If buffer has no contents, move on
  595.         gotoblockend                    * Go to end of buffer contents
  596.         ENDLINE                         * Pos for end of buffer mark
  597.                                         * Needed for last buffer line blank
  598.         #254                            * Add end of buffer mark
  599.         cursordown                      * Move down to next line
  600.         begline endline                 * Test if line is blank
  601.     jfalse DELLINE                      * If blank, go delete it
  602.     jump LOOP                           *ELSE loop again
  603.     NOBUFF:                             * Come here if nothing in buffer
  604.         cursordown                      * Test if we're at end of buffer names
  605.     jfalse PICK                         * If false, PickList is made
  606.         cursorup                        *ELSE cursor up to blank line
  607.         cursorup                        * and to name with no content
  608.         delline                         * Delete buffer name
  609.     DELLINE:
  610.         delline                         * Delete blank line
  611.     jump LOOP                           * Loop again
  612.     PICK:                               * Come here to select from PickList
  613.         zoomwindow                      * Full window for visibity
  614.         unmarkblock                     * Clear last buffer content's block
  615.         begfile                         * Position to select
  616.         pause                           * Pause to select
  617.         markline copy                   * Copy selected buffer name to scrap
  618.         prevwindow                      * Return to starting file
  619.         getscrbuff paste return         * Insert selected buffer contents here
  620.         prevwindow                      * Return to NUL
  621.         quit                            * Quit NUL
  622.         onewindow                       * Close windows if QConfig
  623.     END:                                * set to NOT close on quit
  624. *
  625. * 99 bytes Tue  08-20-1991  11:21:50 (TH @7)
  626.  
  627. * 
  628. * ----------------------------------------------------
  629. * @(8) Remove Buffer Contents Selected From a
  630. *      PickList of All Currently Loaded Buffers
  631. * ----------------------------------------------------
  632. *     This macro enables the user to remove an un-desired Scratch
  633. *     Buffer from currently loaded Scratch Buffers selected from a
  634. *     PickList of all currently active Scratch Buffers.  At the pause,
  635. *     place the cursor line on the name of the buffer to remove and
  636. *     press <enter>.  The selected buffer will be removed or cleared
  637. *     from currently loaded Scratch Buffers as can be confirmed
  638. *     invoking @6 after @8.  This macro is useful for either freeing up
  639. *     memory or removing macros not wished to be saved with @9.
  640.  
  641. *     This macro will ONLY work with line or character blocks, NO
  642. *     column blocks.
  643.  
  644. *     NOTE: You must change 'e:\up\' in this macro to your directory
  645. *           containing BUFF.NAM.  This file must exist for this macro
  646. *           to work and it is easily be made as shown below.
  647.  
  648. @8 macrobegin
  649.         onewindow
  650.         dropanchor                      * Mark file we're in to return to
  651.         editfile "NUL" return quit      * Quit NUL file if loaded
  652.         gotoblockbeg                    * Return to starting file
  653.         unmarkblock                     * Clear mark
  654.         horizontalwindow                * Make two windows
  655.         editfile return                 * Load empty NUL file
  656.         readblock                       * Read file of buffer names
  657.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  658.     LOOP:
  659.         begline                         * Needed in loop
  660.         unmarkblock
  661.         markline                        * Mark next buffer name
  662.         copy                            * Copy name to scrap
  663.         addline                         * Make room for buff contents
  664.         getscrbuff paste return         * Get buffer contents
  665.         endline                         * Pos and test if buff has contents
  666.     jfalse NOBUFF                       * If buffer has no contents, move on
  667.         gotoblockend                    * Go to end of buffer contents
  668.         ENDLINE                         * Pos for end of buffer mark
  669.                                         * Needed for last buffer line blank
  670.         #254                            * Add end of buffer mark
  671.         cursordown                      * Move down to next line
  672.         begline endline                 * Test if line is blank
  673.     jfalse DELLINE                      * If blank, go delete it
  674.     jump LOOP                           *ELSE loop again
  675.     NOBUFF:                             * Come here if nothing in buffer
  676.         cursordown                      * Test if we're at end of buffer names
  677.     jfalse PICK                         * If false, PickList is made
  678.         cursorup                        *ELSE cursor up to blank line
  679.         cursorup                        * and to name with no content
  680.         delline                         * Delete buffer name
  681.     DELLINE:
  682.         delline                         * Delete blank line
  683.     jump LOOP                           * Loop again
  684.     PICK:                               * Come here to select from PickList
  685.         unmarkblock                     * Clear last buffer content's block
  686.         zoomwindow                      * Full window for visibity
  687.         begfile                         * Position to select
  688.         pause                           * Pause to select
  689.         markline copy                   * Copy selected buffer name to scrap
  690.         endline                         * Position of empty space
  691.         dropanchor                      * Mark empty space
  692.         storescrbuff paste return       * Store empty block to selected buff
  693.                                         * removes buffer contents
  694.         unmarkblock                     * Unmark
  695.         quit                            * Quit NUL
  696.         prevwindow                      * Return to starting file
  697.         onewindow                       * Close windows if QConfig
  698.     END:                                * set to NOT close on quit
  699. *
  700. * 101 bytes Tue  08-20-1991  11:18:24 (TH @8)
  701.  
  702. * 
  703. * ----------------------------------------------------
  704. * @(9) Save Contents of All Currently Loaded Buffers
  705. *      To Reload at Next Edit Session with @0
  706. * ----------------------------------------------------
  707. *     This macro saves the  contents of all currently loaded Scratch
  708. *     Buffers to a file BUFF.ALL to be loaded at the next edit session
  709. *     or while editing using @0.  This macro will ONLY work with line
  710. *     or character blocks, NO column blocks.  Any column block buffer
  711. *     saved with @9 will be loaded with @0 as a CHARACTER block.  To
  712. *     run, invoke this macro at any time, and the macro terminates with
  713. *     the file BUFF.ALL containing all Scratch Buffers currently active
  714. *     and having names contained in the file BUFF.NAM, loaded for
  715. *     viewing.  Terminate the editing session or quit the file BUFF.ALL
  716. *     to continue.
  717.  
  718. *     NOTE: You must change 'e:\up\' to your directory containing
  719. *           BUFF.ALL and BUFF.NAM.
  720.  
  721. *     File BUFF.NAM must exist and is a list of buffer names used.  It
  722. *     is included in AMACxx.ZIP and contains the following buffer names
  723. *     in col 1.
  724.  
  725. *                     1 to 10
  726. *                     a to z
  727. *                     . (dot)
  728.  
  729. *     Edit BUFF.NAM to suit your needs.  Buffer names may also be
  730. *     multiple words.
  731.  
  732. *     ┌─────  BUFF.NAM ──────┐
  733. *     │1                     │<-- Buffer names 1 - 10
  734. *     │2                     │
  735. *     │3                     │
  736. *     │4                     │
  737. *     │5                     │
  738. *     │6                     │
  739. *     │7                     │
  740. *     │8                     │
  741. *     │9                     │
  742. *     │10                    │
  743. *     │a                     │ <-- Buffer names a - z
  744. *     │b                     │     excluding 'n' and 't'
  745. *     │|                     │     reserved for BUFFxx.QM macros.
  746. *     │|                     │
  747. *     │z                     │
  748. *     │.                     │ <-- Buffer name '.' (dot) is
  749. *     └──────────────────────┘     reserved as default name.
  750.  
  751. *     The file BUFF.ALL is the contents of Scratch Buffers (Sample from
  752. *     my last editing session is included in AMACxx.ZIP) saved with @9
  753. *     in the form:
  754.  
  755. *     ┌────── BUFF.ALL ──────┐
  756. *     │1                     │<-- Buffer 1 name
  757. *     │Text of buffer 1■     │<-- Buffer 1 content
  758. *     │2                     │<-- Buffer 2 name
  759. *     │This is content of    │<-- Buffer 2 content
  760. *     │buffer number 2.      │               |
  761. *     │                      │               |
  762. *     │Note that buffers may │               |
  763. *     │contain any text      │               |
  764. *     │except for an ASCII   │               |
  765. *     │254.  That is used    │               |
  766. *     │as an end of buffer   │               |
  767. *     │marker                │               |
  768. *     │■                     │<-- NOTE: delimiter on line by itself
  769. *     │3                     │          indicates a blank line.
  770. *     │Buffer 3■             │
  771. *     └──────────────────────┘
  772.  
  773. *     Buffers to be saved may contain any ASCII character except #254,
  774. *     the end of buffer marker.  All scratch buffers are loaded and
  775. *     marked as CHARACTER blocks.
  776.  
  777. @9 macrobegin
  778.         onewindow
  779.         dropanchor                      * Mark file we're in to return to
  780.         editfile "NUL" return quit      * Quit NUL file if loaded
  781.         gotoblockbeg                    * Return to starting file
  782.         unmarkblock                     * Clear mark
  783.         horizontalwindow                * Make two windows
  784.         editfile return                 * Load empty NUL file
  785.         readblock                       * Read file of buffer names
  786.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  787.     LOOP:
  788.         begline                         * Needed in loop
  789.         unmarkblock
  790.         markline                        * Mark next buffer name
  791.         copy                            * Copy name to scrap
  792.         addline                         * Make room for buff contents
  793.         getscrbuff paste return         * Get buffer contents
  794.         endline                         * Pos and test if buff has contents
  795.     jfalse NOBUFF                       * If buffer has no contents, move on
  796.         gotoblockend                    * Go to end of buffer contents
  797.         ENDLINE                         * Pos for end of buffer mark
  798.                                         * Needed for last buffer line blank
  799.         #254                            * Add end of buffer mark
  800.         cursordown                      * Move down to next line
  801.         begline endline                 * Test if line is blank
  802.     jfalse DELLINE                      * If blank, go delete it
  803.     jump LOOP                           *ELSE loop again
  804.     NOBUFF:                             * Come here if nothing in buffer
  805.         cursordown                      * Test if we're at end of buffer names
  806.     jfalse PICK                         * If false, PickList is made
  807.         cursorup                        *ELSE cursor up to blank line
  808.         cursorup                        * and to name with no content
  809.         delline                         * Delete buffer name with no content
  810.     DELLINE:
  811.         delline                         * Delete blank line
  812.     jump LOOP                           * Loop again
  813.     PICK:
  814.         writeblock                      * Begin writeblock
  815.         backspace backspace backspace   * Remove 'nam' extension
  816.         "ALL" return "O"                * Save all scratch buffer contents
  817.                                         *  to BUFF.ALL with overwrite
  818.         editfile return quit            * Quit BUFF.ALL if loaded
  819.         editfile return                 * Load BUFF.ALL to see if all Ok
  820.         onewindow                       * Close windows
  821.     END:
  822. *
  823. * 105 bytes Tue  08-20-1991  11:22:05 (TH @9)
  824.  
  825. * 
  826. * ----------------------------------------------------------------------
  827. * @(F1) Clear Scrap and Scratch Buffers
  828. * ----------------------------------------------------------------------
  829. @F1     macrobegin
  830.         endline cursorright #254 cursorleft cursorleft
  831.         unmarkblock dropanchor
  832.         storescrbuff "name" return
  833.         copy deltoeol begline
  834. *
  835. * 25 bytes Mon  02-17-1992  11:28:39 (TH @F1)
  836.  
  837. * 
  838. * ----------------------------------------------------------------------
  839. * @(F2) Cut CurrentFileName Extension To Scrap
  840. * ----------------------------------------------------------------------
  841. @6      macrobegin insertline unmarkblock markline currentfilename
  842.         find "." return "LB" return jfalse NOEXT
  843.         cursorright
  844.     NOEXT:
  845.         unmarkblock markcolumn endline cut pause delline
  846. *
  847. * 27 bytes Mon  01-27-1992  20:12:19 (TH @F2)
  848.  
  849. * 
  850. * ----------------------------------------------------------------------
  851. * @(F3) Cut CurrentFileName Extension To Scrap, Adds Dot If No Extension
  852. * ----------------------------------------------------------------------
  853. @F3     macrobegin insertline unmarkblock markline currentfilename
  854.         find "." return "LB" return jtrue HASEXT
  855.         "." cursorleft
  856.     HASEXT:
  857.         cursorright unmarkblock markcolumn endline cut pause delline
  858. *
  859. * 30 bytes Mon  01-27-1992  20:12:29 (TH @F3)
  860.  
  861. * (VERSION) HISTORY
  862.  
  863. *   1.0 -   Initial.  Includes @1, @2 and @3.                          8/17/91
  864. *   1.1 -   Added @6. Modified @1, @2 and @3.                          8/19/91
  865. *   1.2 -   Added @4 and @7 - @0.                                      8/20/91
  866. *       -   Swapped @2 and @3 keys.                                    8/22/91
  867. *   1.2a-   Modified documentation.  Changed BUFF.ALL contents.         9/6/91
  868. *   1.3 -   Modified @1-4 for QEdit v2.15.                            10/26/91
  869. *       -   Removed colon from jump, jtrue and jfalse.                11/11/91
  870. *   1.3a-   Added @F1/F2/F3.                                           2/17/92
  871. *
  872. *
  873. *-- eof
  874.